import { NgModule,NgModuleFactoryLoader }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import {Http, Response, Headers, RequestOptions,HttpModule,ConnectionBackend,XHRBackend} from '@angular/http';

import { AppComponent }  from './app.component';
import { routing }  from './app.routing';
import { Login }      from './login/login';
import { Home }      from './home/home';

import { Tile }      from './component/tile.component';
import { ContainerTile }      from './component/containertile.component';
import { GroupContainerTile }      from './component/groupContainertile.component';
import {HTTPService} from './libs/HTTPService';
import {HttpExt} from './libs/HttpExt';
import { Router} from '@angular/router';

import { SharedModule }      from './module/share/share.module';

@NgModule({
  imports: [ 
    BrowserModule,
    routing ,
    HttpModule,
    SharedModule
    ],
  declarations: [ 
    AppComponent,
    Login,
    Home,
    Tile,
    ContainerTile,
    GroupContainerTile
     ],
  providers: [
    HTTPService,
    {
      provide: HttpExt,
    
      useFactory: (backend: XHRBackend, options: RequestOptions,router: Router) => {
        return new HttpExt(backend, options,router);
      },
      deps: [XHRBackend, RequestOptions,Router]
    }
  ],
  bootstrap: [ AppComponent ]
})
export class AppModule { }
